package cn.xjt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xu
 * @Description: TODO
 * @Date: 2021/11/4 21:35
 */
@RestController
@RefreshScope
public class configConrtoller
{
	@Value("${user.username}")
	String userName;
	@Value("${user.hobby}")
	String hobby;
	@Value("${user.sex}")
	String sex;
	@GetMapping("/testConfig")
	public User test()
	{
		User user = new User();
		user.setHobby(hobby);
		user.setUsername(userName);
		user.setSex(sex);
		return user;
	}
}
